﻿<%@ Page Title="CadastroPagina" Language="C#" MasterPageFile="~/Cash.Master" AutoEventWireup="true"
    CodeBehind="CadastroPagina.aspx.cs" Inherits="Cash.View.Administracao.CadastroPagina" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        function redirecionar() {
            var investimento = document.getElementById('<%= hddResult.ClientID %>').value;
            if (investimento == "0") {
                window.location = "Pagina.aspx?Acao=Pesq";
            }
        }
    </script>
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <asp:UpdatePanel runat="server" ID="UpdatePanel" UpdateMode="Conditional">
        <ContentTemplate>
            <table cellpadding="4" cellspacing="0" class="table" style="border-collapse: collapse;"
                align="center">
                <tr>
                    <td align="center" colspan="2" class="titletable">
                        <asp:HiddenField ID="hddResult" runat="server" Value="0" />
                        Cadastro de Pagina
                    </td>
                </tr>
                <tr>
                    <td style="width: 45%" align="right">
                        <asp:Label ID="lblNome" runat="server" Text="Pagina* :"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="txtNome" runat="server" Width="250px" MaxLength="100"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator0" runat="server" ControlToValidate="txtNome"
                            ValidationGroup="validacao" class="validacaoCampos">* Campo obrigatório</asp:RequiredFieldValidator>
                    </td>
                </tr>
                <!-- Nome -->
                <tr>
                    <td style="width: 45%" align="right">
                        <asp:Label ID="lblPai" runat="server" Text="Página Pai:"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:DropDownList ID="ddlPai" runat="server" Width="254px">
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="rfv1" runat="server" ControlToValidate="ddlPai" InitialValue="0"
                            ValidationGroup="validacao" class="validacaoCampos">* Campo obrigatório.</asp:RequiredFieldValidator>
                    </td>
                </tr>
                <!-- Pai -->
                <tr>
                    <td style="width: 45%" align="right">
                        <asp:Label ID="lblDescricao" runat="server" Text="Url:"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="txtUrl" runat="server" Width="250px" MaxLength="100"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtUrl"
                            ValidationGroup="validacao" class="validacaoCampos">* Campo obrigatório</asp:RequiredFieldValidator>
                    </td>
                </tr>
                <!-- url -->
                <tr>
                    <td align="left" colspan="2">
                        <asp:Label ID="lblObrigatorio" runat="server" CssClass="lblObrigatorio">* Campos obrigatórios</asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="center" colspan="2">
                        <asp:Button ID="btnCancelar" runat="server" CssClass="button" Text="Voltar" PostBackUrl="~/View/Configuracao/Pagina.aspx" />
                        &nbsp&nbsp&nbsp&nbsp&nbsp
                        <asp:Button ID="btnCadastrar" runat="server" CommandName="Submit" CssClass="button"
                            Text="Cadastrar" ValidationGroup="validacao" OnClick="btnCadastrar_Click" />
                    </td>
                </tr>
            </table>
            <asp:Label ID="lblTeste" runat="server"></asp:Label>
            <asp:Panel CssClass="modalPopUp" ID="pnlPopUp" Style="display: none;" runat="server">
                <table id="Table1" runat="server">
                    <tr>
                        <td align="center" colspan="2">
                            <asp:Label ID="lblResult" runat="server" Text="" Class="modalLabelInfo"></asp:Label>
                            <br />
                            <br />
                        </td>
                    </tr>
                    <tr>
                        <td align="center" class="titletable" colspan="2">
                            <asp:Button ID="btnMensagemOk" runat="server" CssClass="button" Text="Ok" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BackgroundCssClass="modalBackground"
                OkControlID="btnMensagemOk" DropShadow="true" PopupControlID="pnlPopUp" OnOkScript="redirecionar();"
                PopupDragHandleControlID="Panel1" TargetControlID="lblTeste">
            </asp:ModalPopupExtender>
            <asp:Panel ID="Panel1" runat="server">
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
